from django.db import models


# Create your models here.

# 一级菜单表
class AdminOneMenu(models.Model):
    # 一级菜单名称
    authName = models.CharField(max_length=20, verbose_name="一级菜单名称")
    # 路径
    path = models.CharField(max_length=20, verbose_name="路径")
    # 二级菜单数
    order = models.IntegerField(verbose_name="二级菜单数")

    # 配置模型元数据
    class Meta:
        ordering = ["id"]  # 根据id进行排序
        db_table = "admin_one_menu"  # 创建的表名
        verbose_name = "后台一级菜单表"  # 当前表的别名
        verbose_name_plural = verbose_name

    def __str__(self):
        return '%s:%s' % (self.id, self.authName)


# 二级菜单表
class AdminTwoMenu(models.Model):
    # 一级菜单名称
    authName = models.CharField(max_length=20, verbose_name="一级菜单名称")
    # 路径
    path = models.CharField(max_length=20, verbose_name="路径")
    # 三级菜单数
    order = models.IntegerField(verbose_name="二级菜单数")

    # 配置模型元数据
    class Meta:
        ordering = ["id"]  # 根据id进行排序
        db_table = "admin_two_menu"  # 创建的表名
        verbose_name = "后台二级菜单表"  # 当前表的别名
        verbose_name_plural = verbose_name

    def __str__(self):
        return '%s:%s' % (self.id, self.authName)
